package org.xteam.engine;

import java.util.ArrayList;
import java.util.List;

import org.xteam.engine.object.GraphicalObject;

public class Engine {

	private Camera camera;
	private FrameBuffer frameBuffer;
	private List<GraphicalObject> objects = new ArrayList<GraphicalObject>();

	public void setCamera(Camera camera) {
		this.camera = camera;
	}

	public void setFrameBuffer(FrameBuffer frameBuffer) {
		this.frameBuffer = frameBuffer;
	}

	public void addObject(GraphicalObject object) {
		this.objects.add(object);
	}
	
	public void addAllObject(List<? extends GraphicalObject> objects) {
		this.objects.addAll(objects);
	}

	public void render() {
		frameBuffer.clear();
		for (GraphicalObject object : objects) {
			object.project(frameBuffer, camera);
		}
	}

	public FrameBuffer getFrameBuffer() {
		return frameBuffer;
	}

	public Camera getCamera() {
		return camera;
	}

	

}
